<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.blockchain.front.servlets.trading.ajax.HqList"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="com.blockchain.front.service.content.entity.FriendlyLink"%>
<%@page import="com.blockchain.front.service.content.ContentManage"%>
<html>
<head>
<LINK REL="SHORTCUT ICON" HREF="http://<%configureProvider.format(out,SystemVariable.FRONT_SITE_DOMAIN);%>/favicon.ico"> 
<%
String _TITLE_ = configureProvider.getProperty(SystemVariable.SITE_NAME);
String _DESCRIPTION_ = "BTB，综合数字货币交易平台，拥有专业的团队、先进的技术和资深的行业经验，致力于成为中国最稳定、最安全、最专业、最全面的数字货币、数字资产、虚拟货币综合交易平台。";
CURRENT_SUB_CATEGORY = "SY";
%>
<title><%=_TITLE_ %></title>
<%@include file="/WEB-INF/include/meta.jsp"%> 
<meta http-equiv="Cache-Control" content="no-transform " />
<meta name="baidu-site-verification" content="NKKzOEFKOD" />
<meta name="description" content="<%=_DESCRIPTION_ %>">
<meta content="<%=_TITLE_ %>">
<%@include file="/WEB-INF/include/style.jsp"%>
<link rel="stylesheet" type="text/css" href="<%=controller.getStaticPath(request)%>/css/index.css?v20170323">
<%@include file="/WEB-INF/include/sfrz.jsp"%>
<style type="text/css">
	.word_elli { overflow: hidden; text-overflow:ellipsis; white-space: nowrap; }
	.new831textH2{margin-left:-390px;z-index:11;font-size: 48px;font-weight: bold;color:#fff;text-align: center;position: absolute;width:780px;left: 50%;top: 150px;}
	.new831textH5{margin-left:-215px;z-index:11;font-size: 22px;color:#107dd1;background:#fff;text-align: center;padding:5px 5px;width:430px;position: absolute;left: 50%;top: 270px;}
</style>
</head>
<body>
<%!public static void addCookie(HttpServletResponse response,String name,String value,int maxAge){
	    Cookie cookie = new Cookie(name,value);
	    cookie.setPath("/");
	    if(maxAge>0)  cookie.setMaxAge(maxAge);
	    response.addCookie(cookie);
	}%>
	
	<%!public static String getCookieByName(HttpServletRequest request,String name){
	    Map<String,Cookie> cookieMap = ReadCookieMap(request);
	    if(cookieMap.containsKey(name)){
	        Cookie cookie = (Cookie)cookieMap.get(name);
	        return cookie.getValue();
	    }else{
	        return null;
	    }   
	}%>
	
	<%!private static Map<String,Cookie> ReadCookieMap(HttpServletRequest request){  
	    Map<String,Cookie> cookieMap = new HashMap<String,Cookie>();
	    Cookie[] cookies = request.getCookies();
	    if(null!=cookies){
	        for(Cookie cookie : cookies){
	            cookieMap.put(cookie.getName(), cookie);
	        }
	    }
	    return cookieMap;
	}%>
 
 	<%@include file="/WEB-INF/include/header.jsp"%>
 	<div class="index_pic_wrap po_re">
	<%@include file="/WEB-INF/include/index/advertisement.jsp"%>
	<%@include file="/WEB-INF/include/index/zxjg.jsp"%>
	</div>
	<%{
		ContentManage noticeManage = serviceSession.getService(ContentManage.class);
		PagingResult<Notice> noticeResult = noticeManage.search(
				new Paging() {
					public int getCurrentPage() {
						return 1;
					}
					public int getSize() {
						return 4;
					}
				});
		Notice[] notices = noticeResult.getItems();
	%>
	<%@include file="/WEB-INF/include/index/jyhq.jsp"%>
	<div class="new825Back" style="background:url(<%=controller.getStaticPath(request)%>/images/xinwennews<%=backgroundDataFlag==1?"":backgroundDataFlag==2?"En":"Tw"%>.png) no-repeat 0px 40px;background-size:contain;"></div>
	<div class="coin_news clearfix">
	<%@include file="/WEB-INF/include/index/notice.jsp"%>
	<%@include file="/WEB-INF/include/index/info.jsp"%>
	</div>
    <div class="new825_box">
        <div class="new825Back11" style="background:url(<%=controller.getStaticPath(request)%>/images/anquanIMg<%=backgroundDataFlag==1?"":backgroundDataFlag==2?"En":"Tw"%>.png) no-repeat;background-size:contain;"></div>
        <ul class="newlist816">
            <li>
                <img src="images/security1.png">
                <h3><%=languageDefine.getValue(request, "indexPage_dataSecurity")%></h3>
                <div style="width: 16px;border-bottom: 2px solid #fff;display: inline-block;margin: 18px 0"></div>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_dataStorage")%></p>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_securityMeasures")%></p>
            </li>
            <li>
                <img src="images/security2.png" alt="">
                <h3><%=languageDefine.getValue(request, "indexPage_safeConvenient")%></h3>
                <div style="width: 16px;border-bottom: 2px solid #fff;display: inline-block;margin: 18px 0"></div>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_controlTeam")%></p>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_orderASingle")%></p>
            </li>
            <li>
                <img src="images/security3.png" alt="">
                <h3><%=languageDefine.getValue(request, "indexPage_flashTrading")%></h3>
                <div style="width: 16px;border-bottom: 2px solid #fff;display: inline-block;margin: 18px 0"></div>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_fiberAccess")%></p>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_precision")%></p>
            </li>
            <li>
                <img src="images/security4.png" alt="" style="margin-bottom:24px;">
                <h3><%=languageDefine.getValue(request, "indexPage_careful")%></h3>
                <div style="width: 16px;border-bottom: 2px solid #fff;display: inline-block;margin: 18px 0"></div>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_standard")%></p>
                <p class="word_elli" style="line-height: 30px;"><%=languageDefine.getValue(request, "indexPage_userEx")%></p>
            </li>
        </ul>
    </div>
    <!--new825 end-->
	<div class="footer_con" style="margin: 0px auto;width: 1180px;margin-bottom:40px;">
        <div class="autobox clear">
            <h3 class="new825H4"><%=languageDefine.getValue(request, "indexPage_riskWarning")%></h3>
            <p><%=languageDefine.getValue(request, "indexPage_highRisk")%></p>
        </div>
    </div>

	<%@include file="/WEB-INF/include/footer.jsp"%> 
	<%@include file="/WEB-INF/include/script.jsp"%> 
</body>

<script type="text/javascript" src="<%=controller.getStaticPath(request)%>/js/jquery.cookies.2.2.0.js"></script>
<script>

function goover(){
	var new_box_816_center_ul = $('.new_box_816_center_ul');
    var new_box_816_center_ul_li = new_box_816_center_ul.find('li').eq(0).width();
    wid = new_box_816_center_ul.find('li').length*new_box_816_center_ul_li
    new_box_816_center_ul.width(wid)
    var off = true;
    
    var num = 1;
    function timerSpp(){
        num+=1
        new_box_816_center_ul.css('left',-num)
        if(num>Number(wid)-1200){
            num = 0;
        }
    }

    var timer = setInterval(timerSpp,30) 

    new_box_816_center_ul.hover(function() {
       clearInterval(timer)
    }, function() {
      timer = setInterval(timerSpp,30)
    });
}
</script>

<script type="text/javascript">
var hq_url='<%=controller.getURI(request,HqList.class)%>';
$(function(){
 hqlist();
 goover();
 window.setInterval("hqlist()",20000);  
}); 
function hqlist(){
	$.ajax({
		type : "post",
		dataType : "html",
		url : hq_url,
		success : function(data) {
			var ct = eval('(' + data + ')');
			var blObj = JSON.parse(ct.brokenLines);
			if (ct.num>0) {
				var content = [];
			 	var content_children = "";
			 	var lang = getCookie("lang");
                var langStr = "sell_fullName";
                if (lang == "zh-CN"){
                    langStr = "sell_cnName";  
                } else if(lang == "zh-Tw"){
                    langStr = "sell_cnName"; 
                } else {
                	lang = "en-US";
                }
			 	var scidAry=[];
                var dataAry=[];
                for (var i = 0; i < ct.msg.length; i++) {
                    var ss_ys = "up";
                    var ss_jiantou = "iconsdsdown icon-arrowdown";
                    if (ct.msg[i].rzd > 0) {
                        ss_ys = "down";
                        ss_jiantou = "iconsds icon-arrowup";
                    }

                    scidAry.push(ct.msg[i].scid);
                    dataAry.push(eval("blObj.data_"+ct.msg[i].scid));
                    
                    var s = ['<li class="new_box_816_center_ul_li">',
                    	'<p class="p111">' + eval("ct.msg[i]." + langStr) 
                    	+'('+ct.msg[i].sell_shortName+'/'
                    	+ ct.msg[i].buy_shortName+')</p>',
                        '<div class="' + ss_ys + '">' + ct.msg[i].dqj + '</div>','<div class="' + ss_jiantou  + '"></div>',
                        '</li>'];
                    content.push(s.join(""));

                    var ss_ys = "down";
					var trend_color = "#d8000c";
                    var j = "";
                    if (ct.msg[i].rzd > 0) {
                        ss_ys = "up";
                        j = "+";
						trend_color = "#22a33e";
                    }
                    
					var ss='<li>';
					if(ct.msg[i].is_trade == 'S'){
					    ss+='<a href="<%=controller.getViewURI(request, com.blockchain.front.servlets.trading.index.class)%>?id='+ct.msg[i].scid+'">';
					}else{
						ss+='<a href="#" onclick="connotTrade()">'
					}
					ss+='<dl class="autobox clear">';
					ss+='<dt><i></i><img src="'+ct.msg[i].tblj+'" ><p>';
					ss+=((lang=="zh-Tw"||lang == "zh-CN")?ct.msg[i].sell_cnName:ct.msg[i].sell_shortName)
                    +'/'+((lang=="zh-Tw"||lang == "zh-CN")?ct.msg[i].buy_cnName:ct.msg[i].buy_shortName) + '</p></dt>';
					ss+='<dd class="'+ss_ys+'">'+ct.msg[i].dqj+'</dd>';
					ss+='<dd>'+ct.msg[i].mr_yj+'</dd>';
					ss+='<dd>'+ct.msg[i].mc_yj+'</dd>';
					var cjl = (ct.msg[i].cjl).replace('万','<%=languageDefine.getValue(request, "hq_change")%>');
					var cje = (ct.msg[i].cje).replace('万','<%=languageDefine.getValue(request, "hq_change")%>');
					ss+='<dd>'+cjl+'</dd>';
					ss+='<dd>'+cje+'$</dd>';
					ss+='<dd class="' + ss_ys + '" style="color:' + trend_color + ';">' + j + ''+ ct.msg[i].rzd + '%</dd>',
					ss+='<dd class="'+ss_ys+'">';
					if(ct.msg[i].is_trade == 'S'){
						ss+='<a href="/trading/index/'+ct.msg[i].scid+'.html">'
					} else{
						ss+='<a href="#" onclick="connotTrade()">'
					}
					ss+='<%=languageDefine.getValue(request, "register_goTrade")%>'+'</a></dd>';
					ss+='</dl>';
					ss+='</a>';
					ss+='</li>';
					content_children+=ss;
				}	
			}
			 var tempStr = content.join("")+content.join("")+content.join("");
             $("#indexMarketListsTop").html(tempStr);
             $('.new_box_816_center_ul').width($('.new_box_816_center_ul').find('li').length*200)
             wid = $('.new_box_816_center_ul').find('li').length*200;
			
			$("#price_today_ul").html(content_children); 
			
		}
	
	});
}
//轮播图
var $allItems = $('.my-carousel .my-carousel-inner .item');
var $allIndicators = $('.my-carousel .my-carousel-indicators li');
var currentIndex = 0;
var currentItem = null;
var nextItem = null;
var time;
$(".my-carousel").hover(function () {
    time = window.clearInterval(time)
}, function () {
	if($allIndicators.length <=0){
        return false;
    }
    time = setInterval(function () {
                currentItem = $allItems.filter('.active');
                if (currentIndex + 1 == $allItems.length) {
                    nextItem = $allItems.eq(0);
                    currentIndex = 0;
                } else {
                    nextItem = $allItems.eq(currentIndex + 1);
                    currentIndex++;
                }
                nextItem.addClass('active').fadeIn(500);
                $allIndicators.removeClass('active').eq(currentIndex).addClass('active');
                currentItem.removeClass('active').fadeOut(1000);
            },
            5000);
}).trigger("mouseleave");

$(".my-carousel-indicators li").click(function () {
    var index = parseInt($(this).attr('data-slide-to'));
    if (currentIndex == index - 1) return;
    var oldindex = currentIndex;
    currentIndex = index - 1;
    $allItems.eq(currentIndex).addClass('active').fadeIn(500);
    $allIndicators.removeClass('active').eq(currentIndex).addClass('active');
    $allItems.eq(oldindex).removeClass('active').fadeOut(1000);
});
$(".my-carousel .next").click(function(){
            currentItem = $allItems.filter('.active');
            if (currentIndex + 1 == $allItems.length) {
                nextItem = $allItems.eq(0);
                currentIndex = 0;
            } else {
                nextItem = $allItems.eq(currentIndex + 1);
                currentIndex++;
            }

            nextItem.addClass('active').fadeIn(500);
            $allIndicators.removeClass('active').eq(currentIndex).addClass('active');
            currentItem.removeClass('active').fadeOut(1000);
        });
$(".my-carousel .prev").click(function(){
            currentItem = $allItems.filter('.active');
            if (currentIndex == 0) {
                nextItem = $allItems.eq($allItems.length - 1);
                currentIndex = $allItems.length - 1;
            } else {
                nextItem = $allItems.eq(currentIndex - 1);
                currentIndex--;
            }
            nextItem.addClass('active').fadeIn(500);
            $allIndicators.removeClass('active').eq(currentIndex).addClass('active');
            currentItem.removeClass('active').fadeOut(1000);
        });
        
 
</script>
</html>